import React from 'react'
import './App.less'
import { ConfigProvider, App as AntdApp  } from 'antd';
import themeToken from '@/styles/themeToken'
import { BrowserRouter as Router, useRoutes } from 'react-router-dom';
import routes from '@/routes/index.jsx';
import zhCN from 'antd/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn');

const AppRoutes = () => {
  const element = useRoutes(routes);
  return element;
};

function App() {
  return (
    <ConfigProvider theme={themeToken} locale={zhCN}>
      <AntdApp message={{top: `20px`, duration: 100, maxCount: 1}} 
        notification={{ placement: 'bottomLeft' }}>
        <Router>
          <AppRoutes />
        </Router>
      </AntdApp>
    </ConfigProvider>
  )
}

export default App
